package com.haixiaoke.saas.role.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.core.domain.entity.SysMenu;
import com.haixiaoke.saas.role.domain.BizRoleMenu;
import com.haixiaoke.saas.role.mapper.BizRoleMenuMapper;
import com.haixiaoke.saas.role.service.IBizRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 企业端角色和菜单关联Service业务层处理
 * 
 * @author panda
 * @date 2023-12-29
 */
@Service
public class BizRoleMenuServiceImpl implements IBizRoleMenuService {
    @Autowired
    private BizRoleMenuMapper bizRoleMenuMapper;

    /**
     * 查询企业端角色和菜单关联
     * 
     * @param roleId 企业端角色和菜单关联主键
     * @return 企业端角色和菜单关联
     */
    @Override
    public BizRoleMenu selectBizRoleMenuByRoleId(Long roleId) {
        return bizRoleMenuMapper.selectBizRoleMenuByRoleId(roleId);
    }

    /**
     * 查询企业端角色和菜单关联列表
     * 
     * @param bizRoleMenu 企业端角色和菜单关联
     * @return 企业端角色和菜单关联
     */
    @Override
    public List<BizRoleMenu> selectBizRoleMenuList(BizRoleMenu bizRoleMenu) {
        return bizRoleMenuMapper.selectBizRoleMenuList(bizRoleMenu);
    }

    /**
     * 新增企业端角色和菜单关联
     * 
     * @param bizRoleMenu 企业端角色和菜单关联
     * @return 结果
     */
    @Override
    public int insertBizRoleMenu(BizRoleMenu bizRoleMenu) {
        return bizRoleMenuMapper.insertBizRoleMenu(bizRoleMenu);
    }

    /**
     * 修改企业端角色和菜单关联
     * 
     * @param bizRoleMenu 企业端角色和菜单关联
     * @return 结果
     */
    @Override
    public int updateBizRoleMenu(BizRoleMenu bizRoleMenu) {
        return bizRoleMenuMapper.updateBizRoleMenu(bizRoleMenu);
    }

    /**
     * 批量删除企业端角色和菜单关联
     * 
     * @param roleIds 需要删除的企业端角色和菜单关联主键
     * @return 结果
     */
    @Override
    public int deleteBizRoleMenuByRoleIds(Long[] roleIds) {
        return bizRoleMenuMapper.deleteBizRoleMenuByRoleIds(roleIds);
    }

    /**
     * 删除企业端角色和菜单关联信息
     * 
     * @param roleId 企业端角色和菜单关联主键
     * @return 结果
     */
    @Override
    public int deleteBizRoleMenuByRoleId(Long roleId) {
        return bizRoleMenuMapper.deleteBizRoleMenuByRoleId(roleId);
    }

    @Override
    public int checkMenuExistRole(Long menuId) {
        return bizRoleMenuMapper.checkMenuExistRole(menuId);
    }

    @Override
    public int insertBatchRoleMenu(List<BizRoleMenu> roleDeptList) {
        return bizRoleMenuMapper.insertBatchRoleMenu(roleDeptList);
    }

    @Override
    public List<SysMenu> selectMenuByRoleId(Long roleId) {
        return bizRoleMenuMapper.selectMenuByRoleId(roleId);
    }

    @Override
    public List<Long> selectMenuIdsByRoleId(Long roleId) {
        return bizRoleMenuMapper.selectMenuIdsByRoleId(roleId);
    }

    @Override
    public int deleteBizRoleMenuByMenuId(Long menuId) {
        return bizRoleMenuMapper.deleteBizRoleMenuByMenuId(menuId);
    }
}
